import request from '@/utils/request'

// 获取快捷入口表
export function listEntranceSet(query) {
  return request({
    url: '/setting/entry',
    method: 'get',
    params: query
  })
}
// 新增快捷入口表
export function addEntranceSet(data) {
  return request({
    url: '/setting/entry',
    method: 'post',
    data: data
  })
}

// 修改快捷入口表
export function updateEntranceSet(id, data) {
  return request({
    url: '/setting/entry/' + id,
    method: 'put',
    data: data
  })
}

// 删除快捷入口表
export function delEntranceSet(ids) {
  return request({
    url: '/setting/entry/' + ids + '/delete',
    method: 'delete'
  })
}

//修改快捷入口表启用状态
export function handleEnabledChange(id, enabled){
  const data = {
    enabled
  }
  return request({
    url: '/setting/entry/' + id + '/enabled',
    method: 'put',
    data: data
  })
}

//修改轮播图图片
export function handleImageChange(id, data){
  return request({
    url: '/setting/entry/' + id + '/image',
    method: 'put',
    data: data
  })
}
